/**
 * 
 */
package at.ac.tuwien.swa075.telco.hlr.dao;

import java.util.List;

import at.ac.tuwien.swa075.telco.hlr.HlrException;
import at.ac.tuwien.swa075.telco.hlr.dao.entity.CustomerEntity;

/**
 * @author vovmj01
 *
 */
public interface ICustomerDAO {
	/**
	 * Deletes an existing customer
	 * @param customerId The customer id to delete.
	 * @return true if the customer was deleted.
	 * @throws HlrException An error occured while deleting the customer.
	 */
	public boolean deleteCustomer(int customerId) throws HlrException;
	
	/**
	 * Returns all customers with the given selection criteria
	 * @param imsi The international mobile subscriber id.
	 * @return The list of customers.
	 * @throws HlrException An error occured during search.
	 */
	public List<CustomerEntity> selectCustomers(String firstname, String lastname, String brithDate) throws HlrException;
	
	/**
	 * Returns all customers with a given status.
	 * @param status The status as a string.
	 * @return The list of customers.
	 * @throws HlrException An error occured during search.
	 */
	public List<CustomerEntity> selectCustomersByStatus(String status) throws HlrException;
	
	/**
	 * Lookup a single customer by its customer id.
	 * @param customerId The customer id.
	 * @return The customer.
	 * @throws HlrException An error occured during the lookup.
	 */
	public CustomerEntity findCustomer(int customerId) throws HlrException;
	
	/**
	 * Lookup a single customer identified by one of it's equipment ids.
	 * @param imei The international mobile equipment id.
	 * @return The customer.
	 * @throws HlrException An error occured during lookup.
	 */
	public CustomerEntity findCustomerByEquipment(String imei) throws HlrException;
	
	/**
	 * Lookup a single customer identified by one of it's subscription ids.
	 * @param imsi The international mobile subscription id.
	 * @return The customer.
	 * @throws HlrException An error occured during lookup.
	 */
	public CustomerEntity findCustomerBySubscription(String imsi) throws HlrException;
	
	/**
	 * Creates a new customer with the given data.
	 * 
	 * @param customer The customer object.
	 * @return Returns the customer id.
	 * @throws HlrException An error occured while creating a new customer
	 */
	public int insertCustomer(CustomerEntity customer) throws HlrException;
	
	/**
	 * Updates the data of an existing customer.
	 * @param customer The customer object.
	 * @return Returns true if data was changed.
	 * @throws HlrException An error occured while updating the data.
	 */
	public boolean updateCustomer(CustomerEntity customer) throws HlrException;
}
